package com.newbie.cellsms.action;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class TestJdbc {

	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		Class.forName("org.sqlite.JDBC");
		Connection connection = null;
		connection = DriverManager.getConnection("jdbc:sqlite:/c:/OpenBTS.db");
		Statement statement = connection.createStatement();
		
		statement.setQueryTimeout(30);
//		statement.executeUpdate("drop table if exists person");
//		statement.executeUpdate("create table person (id integer, name string)");
//		statement.executeUpdate("insert into person values(1, 'leo')");
//		statement.executeUpdate("insert into person values(2, 'yui')");
		
		ResultSet rs = statement.executeQuery("select * from config");
		while (rs.next()) {
			System.out.println("name = " + rs.getString("KEYSTRING"));
			System.out.println("id = " + rs.getString("VALUESTRING"));
		}
	}
	public static void create(){
		
	}
}
